package Classes.GameViews.ViewPanels// ActionScript file
{
	import Classes.GameViews.ViewScenes.ViewScene;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.system.ApplicationDomain;

	/**
	 *建筑界面类 
	 * @author 葛增文
	 * 
	 */	
	public class VP_Building extends ViewPanel
	{
		private static var _instance:VP_Building;
		private var _interfaceUI:Sprite;
		public function VP_Building():void
		{
			this.init();
		}
		
		private function init():void
		{
			this._interfaceUI=new (ApplicationDomain.currentDomain.getDefinition("UIBuilding_v") as Class);
			this.addChild(this.interfaceUI);
			this.addListener();
		}
		
		private function addListener():void
		{
			this.addEventListener("close",closeHandler);
		}
		
		private function removeListener():void
		{
			this.removeEventListener("close",closeHandler);
		}
		
		private function closeHandler(e:Event):void
		{
			this.close();
		}
			
		override public function openAt(vs:ViewScene):void
		{
			super.openAt(vs);
			this.toCenter();
		}

		/*getter & setter*/
		public static function get instance():VP_Building
		{
			if(!_instance)_instance=new VP_Building;
			return _instance;
		}

		public function get interfaceUI():Sprite
		{
			return _interfaceUI;
		}


	}
}